08. Lab I: Build a Dog GraphQL API (Set Up)

Lab I: Build a Dog GraphQL API

Similarly to last lesson, but this time with GraphQL, you will work to create a GraphQL API that returns a list of dogs from an embedded H2 in memory database. You'll be able to re-use certain parts of your code from before, although note that you will want to work in a separate project for this lab. As before, you will build on this code throughout each of the lesson's labs, so while it starts with just a small piece, it will get bigger as we go.

Set Up

  • Step 1: Use Spring Initializr to bootstrap a simple project.

    • Add the H2 Database, Spring Web Starter, and the Spring Data JPA dependencies before generating the project.
  • Step 2: Add the necessary GraphQL dependencies manually in your Maven POM file.

    • Go ahead and set up the necessary H2 and GraphQL properties to application.properties at this time as well.